"""
levels.py

contains the definition of all the game's levels.
we can have a level generator in this file should we want random levels
generated rather than in the mainline code.

Concept for levels:

    * Turbines produce X MWs (power) each
    * Over the course of a level, T time, sum of turbines produce MWh (energy).
    * Seagulls hitting turbines stop them spinning proportional to the momentum.
    * a stopped turbine doesn't produce MWh, and hence you will have low score.
    * also using the fan uses MWh, reducing your score."""

import bird
class Level(object):
    turbines = [] # turbines is a list of x, y pairs for turbines.
    birds = {} # a map of bird name to (SeagullType, number_in_wave).
    target_percent = 0 # the target capacity percent actualoutput / maxoutput.
    timelimit = 0 # the cumulative time in (s) for the level.

# first level is actually quite hard.
l1 = Level()
l1.name = 'Level 1 - Single Turbine'
l1.turbines = [(300, 300)]
l1.birds = {'seagull': (bird.Seagull, 30)}
l1.target_percent = 85
l1.timelimit = 20
l1.max_ontarget = 0

# second level could be easiest?
l2 = Level()
l2.name = 'Level 2 - Control'
l2.turbines = [(200, 200), (400, 400)]
l2.birds = {'seagull': (bird.Seagull, 30)}
l2.target_percent = 93
l2.timelimit = 20
l2.max_ontarget = 3

# Level 3. A hard level!
l3 = Level()
l3.name = 'Level 3 - Conflict'
l3.turbines = [(100, 100), (300, 200), (500, 400)]
l3.birds = {'seagull': (bird.Seagull, 30),
            'parrot': (bird.Parrot, 100)}
l3.target_percent = 93
l3.timelimit = 40
l3.max_ontarget = 3

# Level 4. new birds.
l4 = Level()
l4.name = 'Level 4 - Hallet WF'
l4.turbines = ([(x*100, 100) for x in range(1, 3)]
                + [(100, 350), (450, 400)])
l4.birds = {'seagull': (bird.Seagull, 40),
            'parrot': (bird.Parrot, 100),
            'black swan': (bird.BlackSwan, 400)}
l4.target_percent = 94
l4.timelimit = 40
l4.max_ontarget = 3


levels = [l1, l2, l3, l4]
